/**
 * @filename:InventoryService Dec 11, 2023
 * @project Wonder Vue Admin Api  1.1.0
 * Copyright(c) 2022 Wonder Co. Ltd.
 * All right reserved.
 */
package com.wonder.app.service;
import cn.hutool.json.JSONObject;
import com.vtuzx.core.bean.dto.VtuzxMap;
import com.wonder.app.domain.Inventory;
import com.wonder.app.request.InventoryRequest;
import com.wonder.bean.kingdee.xqc.BillMaterial;
import com.wonder.common.common.AjaxResult;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wonder.constant.BillEvent;
import com.wonder.constant.BillType;

import javax.swing.text.Document;
import java.util.List;
import java.util.Map;
/**
 * @Description:TODO(即时库存服务层)
 * @version: 1.1.0
 * @author: Wonder
 *
 */
public interface InventoryService extends IService<Inventory> {


    /**
     * 验证即时库存信息
     *
     * @param inventory
     * @param type
     * @return 结果
     */
    public String validate(Inventory inventory,String type);


    /**
     * Description:即时库存分页返回
     * @param request//检索条件
     * @param page//分页参数
     * @return IPage<Inventory>   //分页记录
     */
    public IPage<Inventory> selectList(InventoryRequest request, Page<Inventory> page);


    /**
     * 即时库存入库方法
     * @param userId
     * @param userName
     * @param billEvent 单据状态
     * @param billType 单据类型
     * @param billNo 单据编号
     * @param dataList 入库数据
     * @throws Exception
     */
    public Map<String,Object> addInventory(Long userId, String userName, BillEvent billEvent, BillType billType, String billNo, List<BillMaterial> dataList)throws Exception;

    /**
     * 即时库存出库方法
     * @param userId
     * @param userName
     * @param billEvent
     * @param billType
     * @param billNo
     * @param dataList
     * @throws Exception
     */
    public Map<String,Object> reduceInventory(Long userId, String userName, BillEvent billEvent, BillType billType,String billNo, List<BillMaterial> dataList)throws Exception;

    /**
     * 读取excle导入及时库存
     * @param map
     * @return
     */
    boolean readInventory(JSONObject map) throws Exception;
}
